package com.lantosec.hmrp.modules.eval.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.lantosec.hmrp.core.mvc.BaseVO;
import com.lantosec.hmrp.modules.eval.entity.EvalPlan;
import com.lantosec.hmrp.modules.eval.entity.EvalPlanExecutor;
import com.lantosec.hmrp.modules.eval.entity.EvalPlanTarget;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 考评计划 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-17
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="EvalPlan对象", description="考评计划")
public class EvalPlanVO extends BaseVO<EvalPlan> {
    private static final long serialVersionUID = 1L;


    public EvalPlanVO(EvalPlan entity){
        this.evalPlanId = entity.getEvalPlanId();
        this.evalPlanName = entity.getEvalPlanName();
        this.evalPlanType = entity.getEvalPlanType();
        this.execDeptId = entity.getExecDeptId();
        this.evalPlanCycle = entity.getEvalPlanCycle();
        this.evalPlanCycleNum = entity.getEvalPlanCycleNum();
        this.startDate = entity.getStartDate();
        this.endDate = entity.getEndDate();
        this.evalMode = entity.getEvalMode();
        this.executorMode = entity.getExecutorMode();
        this.targetMode = entity.getTargetMode();
        this.state = entity.getState();
        this.execNum = entity.getExecNum();
        this.delay = entity.getDelay();
        this.createUserId = entity.getCreateUserId();
        this.createUser = entity.getCreateUser();
        this.createTime = entity.getCreateTime();
        this.editorUserId = entity.getEditorUserId();
        this.editorUser = entity.getEditorUser();
        this.editorTime = entity.getEditorTime();
        this.planTargetId = entity.getPlanTargetId();
        this.targetNum = entity.getTargetNum();
    }

    @Override
    public EvalPlan convertToEntity(){
        return new EvalPlan(this);
    }


    @ApiModelProperty(value = "考评计划ID")
    private Integer evalPlanId;

    @ApiModelProperty(value = "考评计划名称")
    private String evalPlanName;

    @ApiModelProperty(value = "考评计划类型(1常规计划2专项计划)")
    private Integer evalPlanType;

    @ApiModelProperty(value = "考评计划周期(0临时2周3月4季度5年)")
    private Integer evalPlanCycle;

    @ApiModelProperty(value = "执行责任科室")
    private String execDeptId;

    @ApiModelProperty(value = "考评计划周期执行次数(默认1)")
    private Integer evalPlanCycleNum;

    @ApiModelProperty(value = "计划开始日期")
    private String startDate;

    @ApiModelProperty(value = "计划结束日期")
    private String endDate;

    @ApiModelProperty(value = "考评形式(1填报2巡查)")
    private Integer evalMode;

    @ApiModelProperty(value = "执行者形式(1指定部门2指定个人)")
    private Integer executorMode;

    @ApiModelProperty(value = "考核对象形式(1指定部门2指定个人3全部人员)")
    private Integer targetMode;

    @ApiModelProperty(value = "计划状态(1暂停2启用3到期4作废)")
    private Integer state;

    @ApiModelProperty(value = "记录执行次数")
    private Integer execNum;

    @ApiModelProperty(value = "允许延期(工作日)")
    private Integer delay;

    @ApiModelProperty(value = "创建人ID")
    private String createUserId;

    @ApiModelProperty(value = "创建人")
    private String createUser;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "最后编辑人ID")
    private String editorUserId;

    @ApiModelProperty(value = "最后编辑人")
    private String editorUser;

    @ApiModelProperty(value = "最后编辑时间")
    private Date editorTime;

    @ApiModelProperty(value = "考评任务ID")
    private Integer evalTaskId;

    @ApiModelProperty(value = "考评对象ID")
    @TableField(exist = false)
    private Integer planTargetId;

    @ApiModelProperty(value = "执行对象数")
    private Integer targetNum;

    @ApiModelProperty(value = "执行完成数")
    private Integer performNum;

    @ApiModelProperty(value = "执行进度")
    private Integer progress;

    @ApiModelProperty(value = "执行者")
    private String executorUser;

    @ApiModelProperty(value = "执行时间")
    private Date executorTime;

    @ApiModelProperty(value = "考评计划的执行者集合")
    private List<EvalPlanExecutor> evalPlanExecutorList;

    @ApiModelProperty(value = "考评计划的考评对象集合")
    private List<EvalPlanTarget> evalPlanTargetList;

    @ApiModelProperty(value = "考评任务的考评明细列表")
    private List<EvalDetailedVO> evalDetailedVOList;

    @ApiModelProperty(value = "执行人")
    @TableField(exist = false)
    private String executorId;
    @ApiModelProperty(value = "执行责任科室")
    private String execDeptName;

}
